package responsible;

import responsible.pojo.ConsoleLogger;
import responsible.pojo.InfoLogger;
//todo 避免请求发送者与接收者耦合在一起，让多个对象都有可能接收请求，将这些对象连接成一条链，并且沿着这条链传递请求，直到有对象处理它为止
public class demo {
    public static void main(String[] args) {
        int level = 1;
        String message = "xxx";
        if (level == 1){
            ConsoleLogger consoleLogger = new ConsoleLogger(level++);
            consoleLogger.logMessage(level,message);
        }else if (level==2){
            InfoLogger infoLogger = new InfoLogger(level);
            infoLogger.logMessage(level,message);
        }
    }
}
